%load_ext pretty_jupyter
Cell-level Metadata¶
Code Cell¶
# -.-|m { input: true, output: true, input_fold: show}
a = 10
print(a)
10
Jinja Markdown Cell¶
%%jmd
[//]: # (-.-|m { input: true, output: false, input_fold: show })
This Jinja Markdown has input on and output off.
¶
We can also show or hide output errors, for example:
# -.-|m { output_error: true, input: true}
raise ValueError("Some Error.")
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[9], line 3 1 # -.-|m { output_error: true, input: true} ----> 3 raise ValueError("Some Error.") ValueError: Some Error.
%%jmd
**Alternatively, we can modify the cell in its metadata. For example, this cell has an input turned on
from there.**
Note that each cell can its metadata set only from code or notebook metadata. If we specify it in both places, the cell-level metadata specified in code take precedence.
[//]: # (-.- .alert .alert-warning)
Alternatively, we can modify the cell in its metadata. For example, this cell has an input turned on from there.
Note that each cell can its metadata set only from code or notebook metadata. If we specify it in both places, the cell-level metadata specified in code take precedence.
Notebook-level Metadata¶
Notebook-level metadata work very similarly to the cell-level metadata. Again, we can specify it both in the notebook metadata or in the code.
If we want to specify it in the code, we need to put it in the first cell with type raw.
Notebook-level metadata specify notebook-level settings that can be often overriden on the cell-level.